define([
    'jquery',
    'underscore',
    'backbone',
    'views/service/select-item',
    'iscroll'
], function ($, _, Backbone, ServiceListItemView) {
    var ServiceListView = Backbone.View.extend({

        tagName:'select',

        initialize:function () {

        },

        render:function (eventName) {
            var defaultOption='<option value="">-Select-</option>';
            $(this.el).attr('id','serviceList').append(defaultOption);
            _.each(this.model.models, function (service) {
                var temp=service.toJSON();
                var option='<option value="'+temp.id+'">'+temp.name+'</option>';
                //$(this.el).prepend(new ServiceListItemView({model:service}).render().el);
                $(this.el).append(option);
            }, this);
            return this;
        }

    });
    return ServiceListView;
});

